package com.ruoyi.web.controller.report;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.report.domain.dto.PerViewDataDto;
import com.ruoyi.report.service.IReportPerDataService;
import com.ruoyi.report.service.IReportWorkbookDataService;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version v1.0
 * @ProjectName: report
 * @ClassName: ReportPerView
 * @Description: 预览页面数据处理接口controller
 * @Author: sunyan
 * @Date: 2022/3/4 16:13
 */
@RestController
@RequestMapping("/report/perView")
public class ReportPerViewController {

    @Autowired
    IReportPerDataService reportPerDataService;

    @Autowired
    IReportWorkbookDataService reportWorkbookDataService;


    @PostMapping("data")
    public AjaxResult getPerViewData(@RequestBody PerViewDataDto perViewDataDto){
        return AjaxResult.success(reportPerDataService.selectPerData(perViewDataDto));
    }

    @PostMapping("query")
    public AjaxResult getPerViewQuery(@RequestBody PerViewDataDto perViewDataDto){
        System.out.println(perViewDataDto);
        return AjaxResult.success(reportPerDataService.getQuery(perViewDataDto));
    }

}
